#!/bin/sh
#
# postinstall - this script will be executed after the MySQL PKG
# installation has been performed.
#
# This script will install the MySQL privilege tables using the
# "mysql_install_db" script and will correct the ownerships of these files
# afterwards.
#
# it also starts mysqld after install

if [ ! -f %OPTWARE_TARGET_PREFIX%/var/lib/mysql/mysql/db.frm ] ; then
	%OPTWARE_TARGET_PREFIX%/bin/mysql_install_db
fi

if [ -d %OPTWARE_TARGET_PREFIX%/var/lib/mysql ] ; then
    chown -R root:root %OPTWARE_TARGET_PREFIX%/var/lib/mysql
fi

%OPTWARE_TARGET_PREFIX%/etc/init.d/S70mysqld start
